package com.jt.controller;

import com.jt.pojo.UserPojo;
import com.jt.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @GetMapping("/findAll")
    public List<UserPojo> findAll(){
        return userService.findAll();
    }

    @PostMapping("/insertUser")
    public void insertUser(UserPojo userPojo){
        userService.insertUser(userPojo);
    }

    @PostMapping("/updateUser")
    public void updateUser(UserPojo userPojo){
        userService.updateUser(userPojo);
    }
    @DeleteMapping("/deleteUser")
    public void deleteUser(UserPojo userPojo){
        userService.deleteUser(userPojo);
    }
}
